Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #1330 (our open PR #1344 explicitly leaves the pushed-HEAD case out of scope).
A server push whose request uses
:method: HEADis treated like GET, so a valid bodyless pushed200withcontent-length: 5is rejected withInvalidBodyLengthError: Expected 5 bytes, received 0.Root cause
H2Stream.remotely_pushed()set_authoritybut never setrequest_method, so_initialize_content_length()could not apply the HEAD exemption.send_headers()already sets it for normal requests.Fix
Set
self.request_method = extract_method_header(pushed_headers)inremotely_pushed(). One line, no new branch.Verification
TestPushedHeadRequestwith HEAD and GET controls. Base-red: HEAD case failed withInvalidBodyLengthError, GET control passed (1 failed / 1 passed).fail_under=100satisfied).ruff check src/: clean.mypy --strict src/and--strict-bytes: clean.A pre-existing Hypothesis
differing_executorshealth check intest_invalid_headers.pywas suppressed externally for the full run; no repo file was changed for it.